package cn.itrip.biz.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * Created by Administrator on 2018/11/21.
 */

@Configuration  // <beans> <bean id="userService" class="Docket"></bean> <bean></bean>    </beans>
@EnableSwagger2
@ComponentScan({"cn.itrip.biz.controller"})
public class SwaggerConfig {
        @Bean//<bean id="docket" class="Docket">
        public Docket docket(){
            Docket docket=new Docket(DocumentationType.SWAGGER_2);
            docket.apiInfo(ApiInfo());
            return docket;
        }
        @Bean
        public ApiInfo ApiInfo(){
            return new ApiInfo("爱旅行项目",
                    "这是一个去玩的网",
                    "v1.0",
                    "http://www.baidu.com",
                    "周剑鸣，李小博",
                    "授权来源",
                    "http://www.163.com");
        }

}
